package com.zlm.user.emp.controller;

import com.zlm.common.base.BaseController;
import com.zlm.common.constants.CodeConstants;
import com.zlm.common.dto.JsonResultDto;
import com.zlm.user.emp.service.SysIndustryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 行业controller
 * @Author: duyufu
 * @Date: 2019/4/24 14:19
 */
@RestController
@RequestMapping(value = "/industry")
public class SysIndustryController extends BaseController {
    @Autowired
    private SysIndustryService sysIndustryService;

    /**
     * 查询所有行业
     * @return
     */
    @GetMapping("/getAllIndustry")
    public JsonResultDto getAllIndustry() {
        try {
            List<Map<String, Object>> allIndustry = sysIndustryService.getAllIndustry();
            return success(allIndustry);
        } catch (Exception e) {
            e.printStackTrace();
            return fail(CodeConstants.CODE_BUSY);
        }
    }

}
